<template>
      <table class="my-table">
      <thead>
        <tr>
          <slot name="head"></slot>
        </tr>
      
      </thead>
      <tbody>
        <tr v-for="(item,index) in data" :key="item.id">
         <slot name="body" :item="item" :index="index"></slot>
        </tr>
       
      </tbody>
    </table>
</template>

<script>
export default {
props:{
  data:{
    type:Array,
    require:true
  }
}
}
</script>

<style scope>
.table-case .my-table {
    width: 100%;
    border-spacing: 0;  
  }
  .table-case .my-table img {
      width: 100px;
      height: 100px;
      object-fit: contain;
      vertical-align: middle;
    }
    .table-case .my-table th {
      background: #f5f5f5;
      border-bottom: 2px solid #069;
    }
    .table-case .my-table  td {
      border-bottom: 1px dashed #ccc;
    }

    .table-case .my-table   td,
    th {
      text-align: center;
      padding: 10px;
      transition: all 0.5s;
   
    }
    /* .table-case .my-table td,
    th .red {
        color: red;
      } */

    .table-case .my-table  .none {
      height: 100px;
      line-height: 100px;
      color: #999;
    }


</style>